import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {path: '/login',
  component: () => import('@/components/MyLogin.vue')
},
{
  path: '/home',
  component: () => import('@/components/MyHome.vue'),
  children:[
    {path:'users',component:()=>import('@/components/menus/MyUsers.vue')},
    {path:'goods',component:()=>import('@/components/menus/MyGoods.vue')},
    {path:'orders',component:()=>import('@/components/menus/MyOrders.vue')},
    {path:'rights',component:()=>import('@/components/menus/MyRights.vue')},
    {path:'settings',component:()=>import('@/components/menus/MySettings.vue')},
    {path:'/detail/:id',component:()=>import('@/components/user/MyUserDetail.vue'),props: true}
  ]
}
]

const router = new VueRouter({
  routes
})

export default router
